﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Ajax_WCFService.aspx.cs"
    Inherits="TestDemo_Ajax_WCFService" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>WCF Ajax Enabled Service</title>
    <script language="javascript" type="text/javascript">

        function displayDemoControl(result) {
            $get("DemoID").innerHTML = result;
            document.getElementById("DemoID").innerHTML = result;
        }

        function onFailed() {
            alert('onFailed');
        }

        window.onload = function () {

            DemoService.GetDemoControl(1, displayDemoControl, onFailed);

        };
    
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/App_Services/DemoService.svc" />
        </Services>
    </asp:ScriptManager>
    <div style="padding: 20px;">
        测试技巧：使用User Control做HTML生成
        <br />
        ajax-enabled wcf service
    </div>
    <div id="DemoID">
    </div>
    </form>
</body>
</html>
